package cn.gdrj.est.request;

import cn.gdrj.est.annotations.TemporalIntervalTimeSegment;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 提交维修订单的请求数据
 *
 * @author jun
 * @date 2021/11/10
 */
@Data
public class SubmitOrderRequest {
    @NotNull(message = "评估信息id不能为空")
    private Long evaluateId;
    @NotNull(message = "联系人手机号不能为空")
    @Pattern(regexp = "1[356789]\\d{9}",message = "手机号码格式不正确")
    private String phone;
    // url?adress=
    @NotNull(message = "预约维修地址不能为空")
    @Size(message = "预约维修地址信息的长度在10-50个字符之间")
    private String adress;
    @NotNull(message = "验证码不能为空")
    @Size(message = "验证码的长度只能是6个数字")
    private String sms;
    @NotNull(message = "预约日期不能为空")
    @Future(message = "时间只能是将来的时间")
    // @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date appintDate;
    @NotNull(message = "预约时间段不能为空")
    @TemporalIntervalTimeSegment(values = {1,2})
    private Integer temporalInterval;
}
